﻿using System;
using System.Collections.Generic;
using System.Text;

namespace PdfLib.TextScraping
{
    /// <summary>
    /// 
    /// </summary>
    public class TableFooterDetector
    {
        /// <summary>
        /// 
        /// </summary>
        /// <param name="pdfFilePath"></param>
        /// <param name="pageNum"></param>
        /// <param name="footerDetector"></param>
        /// <returns></returns>
        public static double DetectTableFooter(
            string pdfFilePath, int pageNum, 
            TableFooterDetectorInstruction footerDetector)
        {
            if(footerDetector.TableFooterType==TableFooterType.EndOfPage)
            {
                return 1.0;
            }
            else
            {
                double matchScore = 0.0;
                PdfPatternSearcher.FoundPattern(
                    pdfFilePath, pageNum,
                    footerDetector.TableFooter,
                    footerDetector.UseRegex,
                    footerDetector.MatchScoreThreshold,
                    ref matchScore);
                return matchScore;
            }
        }
    }
}
